package org.dreamfly.core.util;

import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by IntelliJ IDEA.
 * User: Gin
 * Date: 2010-12-5
 * Time: 0:42:39
 * To change this template use File | Settings | File Templates.
 */
public class SessionListener implements HttpSessionListener {
    public static Map userMap = new HashMap();
    private   SessionContext myc=SessionContext.getInstance();

    public void sessionCreated(HttpSessionEvent httpSessionEvent) {
        myc.AddSession(httpSessionEvent.getSession());
    }

    public void sessionDestroyed(HttpSessionEvent httpSessionEvent) {
        HttpSession session = httpSessionEvent.getSession();
        myc.DelSession(session);
    }
}
